{template 'common/header'}
<div class="list-group">
    <p class="list-group-item" style="background-color: #D9EDF7;margin:0 auto">PC端网站信息基本设置</p>
    <div class="list-group-item" style="margin: 0 auto">
        <form action="" method="post" class="form-horizontal">
            <div class="form-group">
                <label for="title" class="col-sm-2 control-label">模板id</label>
                <div class="col-sm-10">
                    <input type="text" name="title" id="title" value="{$pcset['title']}" class="form-control">
                </div>
            </div>
            <div class="form-group">
                <div id="index-div">
                </div>
            </div>
            <input type="hidden" name="id" value="{$pcset['id']}">
            <input type="hidden" name="token" value="{$_W['token']}">
            <div style="float: right;margin:10px">
                <input type="submit" name="submit" value="保存设置" class="btn btn-info" >
            </div>
            <div style="clear: both;"></div>
        </form>
    </div>
</div>
<script>
    var i=1;
    $(function () {
        var html = "";
        html += '<div class="form-group">';
        html += '<label class="col-md-2 control-label">关键词';
        html += '</label>';
        html += '<div class="col-sm-3 col-md-3 col-xs-3">';
        html += '<input type="text" name="keywords" value="" placeholder="关键词" class="form-control">';
        html += '</div>';
        html += '<div class="col-sm-1 col-md-1 col-xs-1 my-icon">';
        html += '<a href="javascript:;" class="addInputReturn" >';
        html += '<span class="glyphicon glyphicon-plus"></span>';
        html += '</a>';
        html += '</div>';
        html += '</div>';
        $("#index-div").append(html);
    })
    /**
     * 动态添加事件
     */
    $("body").on('click','.addInputReturn',function () {
        //添加减号
        var $content = "";
        $content += '<a href="javascript:;" class="delInput" >';
        $content += '<span class="glyphicon glyphicon-minus"></span>';
        $content += '</a>';
        $(this).parent().append($content);
        //去除加号
        this.remove();
        var html = "";
        var name = 'keywords'+i;
        html += '<div class="form-group">';
        html += '<label class="col-md-2 control-label">关键词';
        html += '</label>';
        html += '<div class="col-sm-3 col-md-3 col-xs-3">';
        html += '<input type="text" name="'+name+'" value="" placeholder="关键词" class="form-control">';
        html += '</div>';
        html += '<div class="col-sm-1 col-md-1 col-xs-1 my-icon">';
        html += '<a href="javascript:;" class="addInputReturn" >';
        html += '<span class="glyphicon glyphicon-plus"></span>';
        html += '</a>';
        html += '</div>';
        html += '</div>';
        $("#index-div").append(html);
        i = i+1;
    })
    /**
     * 删除事件
     */
    $("body").on('click','.delInput',function () {
        //获取当前点击的元素的父级的父级进行删除
        $(this).parent().parent().remove();
    })
</script>
{template 'common/footer'}